xen/arm64: Implement a fast path for handling SMCCC_ARCH_WORKAROUND_1
authorJulien Grall <julien.grall@arm.com>
Fri, 23 Feb 2018 18:57:17 +0000 (18:57 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 26 Feb 2018 22:59:09 +0000 (14:59 -0800)
commitce73d72e976cc54f01c85e5c04edd5b9ce7b0906
tree8128d4079289d7148803bf9b855599c146b99705
parent2bd4f05113609ffcba908047576086386311798a
xen/arm64: Implement a fast path for handling SMCCC_ARCH_WORKAROUND_1

The function SMCCC_ARCH_WORKAROUND_1 will be called by the guest for
hardening the branch predictor. So we want the handling to be as fast as
possible.

As the mitigation is applied on every guest exit, we can check for the
call before saving all the context and return very early.

For now, only provide a fast path for HVC64 call. Because the code rely
on 2 registers, x0 and x1 are saved in advance.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Volodymyr Babchuk <volodymyr.babchuk@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
xen/arch/arm/arm64/entry.S
xen/include/asm-arm/processor.h